package com.example.gugongticket.dao;

import com.example.gugongticket.entity.SalesStatistics;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface SalesStatisticsRepository extends JpaRepository<SalesStatistics, Integer> {
    SalesStatistics findByDate(Date date);


    @Query(value = "SELECT * FROM salesstatistics WHERE date =?1", nativeQuery = true)
    List<SalesStatistics> findBySDate(String date);


    @Query(value = "SELECT * FROM salesstatistics WHERE date =?1", nativeQuery = true)
    SalesStatistics findBysDate(String date);

    List<SalesStatistics> findByDateBetween(Date startDate, Date endDate);
}